package com.itheima.reggie.config;


import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



@Configuration
public class MybatisPlusConfig {


    //mybatis 内置的拦截器
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        //创建mybatis内置的拦截器
            MybatisPlusInterceptor mpInterceptor=new MybatisPlusInterceptor();
        //添加分页的拦截器
        mpInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());

        return mpInterceptor;
    }
}
